#ifndef THREADDOWNLOAD_H
#define THREADDOWNLOAD_H

#include <QWidget>
#include <QCloseEvent>
#include <QPoint>
#include <QSystemTrayIcon>
#include "downloadmovewidgetabstract.h"

class DownloadListWidgets;
class DownloadBgSkinDialog;

namespace Ui {
class DownloadApplication;
}

class DownloadApplication : public DownloadMoveWidgetAbstract
{
    Q_OBJECT
public:
    explicit DownloadApplication(QWidget *parent = 0);
    ~DownloadApplication();

signals:

public slots:
    void windowIconActivated(QSystemTrayIcon::ActivationReason);
    void downloadAddNewFile();
    void downloadStateChanged(bool&);
    void downloadShowBgSkin();
    void downloadBgTransparentChanged(int);
    void downloadBackgroundSkinChanged(const QString &);

protected:
    virtual void closeEvent(QCloseEvent *event);
    void readXMLConfigFromText();
    void writeXMLConfigFromText();
    void initWindowSurface();
    void creatSystemTrayIcon();
    void setMenuBarButton();
    void setButtonCursor();
    void setButtonTips();
    Ui::DownloadApplication *ui;

    QSystemTrayIcon* m_systemTray;
    QMenu* m_systemTrayMenu;
    DownloadListWidgets* m_listWidget;
    DownloadBgSkinDialog* m_backgroundSkinDialog;

    QString m_currentBgSkin;
    int m_alpha;

};

#endif // THREADDOWNLOAD_H
